

<div class="choose-image">
    <ul class="tabs-nav">
        <li <?php if(I('get.curpage') == ''){?>class="tabs-selected"<?php }?>><a href="javascript:void(0)">网络图片</a></li>
        <!--<?php if(I('get.type') != 'm'){?><li <?php if(I('get.curpage') != ''){?>class="tabs-selected"<?php }?>><a href="javascript:void(0)">相册图片</a></li><?php }?>-->
    </ul>
    <div class="url-image tabs-panel <?php if(I('get.curpage') != ''){?>tabs-hide<?php }?>">
        <label><i></i>输入图片地址</label>
        <input name="" type="text" class="text w400" nctype="imageurl" />
        <div class="handle-bar" style="padding-left:0px;"><a href="Javascript: void(0)" class="button" nctype="imageurl">插入到话题</a></div>
    </div>
    <div class="goods-gallery tabs-panel <?php if(I('get.curpage') == ''){?>tabs-hide<?php }?>">
        <div class="nav"><i></i>从我的相册中选择图片
            <select name="jumpMenu" id="jumpMenu" style="width:100px;">
                <option value="0" style="width:80px;">请选择...</option>
                <?php if(!empty($class_list)){?>
                <?php foreach(($class_list) as $val) { ?>
                <option style="width:80px;" value="<?php echo $val['ac_id']; ?>" <?php if($val['ac_id']==I('get.class_id')){echo 'selected="selected"';}?>><?php echo $val['ac_name']; ?></option>
                <?php } ?>
                <?php }?>
            </select>
        </div>
        <ul class="list">
            <?php if(!empty($pic_list)){?>
            <?php foreach (($pic_list) as $v){?>
            <li><a href="javascript:void(0);" nctype="chooseimage" data-param="{'img':'<?php echo UPLOAD_SITE_URL.'/'.ATTACH_MALBUM.'/'.session('member_id').'/'.$v['ap_cover'];?>'}"><img src="<?php echo UPLOAD_SITE_URL.'/'.ATTACH_MALBUM.'/'.session('member_id').'/'.str_ireplace('.', '_240.', $v['ap_cover']);?>" title='<?php echo $v['ap_name'];?>'/>
                <p class="extra">已选择</p>
            </a></li>
            <?php }?>
            <?php }else{?>
            <span>您还没有上传过图片</span>
            <?php }?>
        </ul>
        <div class="ubb-pagination"><?php echo $show_page; ?></div>
        <div class="handle-bar" style="padding-left:0px;"><a href="Javascript: void(0)" class="button" nctype="imagealbum">插入到话题</a></div>
    </div>
</div>
<script>
    var c_id = <?php echo $c_id;?>;
    $(function() {
        $(".tabs-nav > li > a").mousedown(function(e) {
            if (e.target == this) {
                var tabs = $(this).parent().parent().children("li");
                var panels = $(this).parent().parent().parent().children(".tabs-panel");
                var index = $.inArray(this, $(this).parent().parent().find("a"));
                if (panels.eq(index)[0]) {
                    tabs.removeClass("tabs-selected")
                            .eq(index).addClass("tabs-selected");
                    panels.addClass("tabs-hide")
                            .eq(index).removeClass("tabs-hide");
                }
            }
        });
        // 翻页跳转
        $('.choose-image').find('a[class="demo"]').click(function(){
            DialogManager.close('uploadimage');
            var _uri = $(this).attr('href');
            CUR_DIALOG = ajax_form("uploadimage", '选择图片', _uri, 480);
            return false;
        });
        // 选择分类跳转
        $('#jumpMenu').change(function(){
            DialogManager.close('uploadimage');
            var _uri = "<?php echo url('circle/theme/choose_image');?>?curpage=1&c_id="+c_id+"&class_id="+$(this).val();
            CUR_DIALOG = ajax_form("uploadimage", '选择图片', _uri, 480);
        });
        // 选择相册图片
        $('.choose-image').find('a[nctype="chooseimage"]').click(function(){
            $('.choose-image').find('a[nctype="chooseimage"]').removeClass('selected');	// 移除分类
            $(this).addClass('selected');	// 添加分类
        });
    });
</script>